package cn.com.wangluotongxin.merchants.service.impl.dubbo;

import cn.com.wangluotongxin.common.utils.TenantUtils;
import cn.com.wangluotongxin.merchants.DMerchantsRoleService;
import cn.com.wangluotongxin.merchants.dto.DMerchantsRoleDto;
import cn.com.wangluotongxin.merchants.service.IMerchantsRoleService;
import cn.com.wangluotongxin.merchants.vo.DMerchantsRoleVo;
import com.alibaba.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class DMerchantsRoleServiceImpl implements DMerchantsRoleService {

    @Autowired
    private IMerchantsRoleService roleService;

    @Override
    public IPage<DMerchantsRoleVo> getPage(String tenantId, DMerchantsRoleDto dto) {
        TenantUtils.set(tenantId, tenantId);
        IPage<DMerchantsRoleVo> page = roleService.getPage(dto);
        TenantUtils.remove();
        return page;
    }

    @Override
    public DMerchantsRoleVo detail(String tenantId, Integer id) {
        TenantUtils.set(tenantId, tenantId);
        DMerchantsRoleVo roleVo = roleService.detail(id);
        TenantUtils.remove();
        return roleVo;
    }
}
